<template>
    <div class="statistics-list">
        <div class="left">
            <img :src="props.data.img" alt="" />
        </div>
        <div class="right">
            <div class="item" v-for="item in props.data.list" :key="item.name">
                <div class="content">{{ item.name }}</div>
                <div class="end">
                    <div class="count">{{ item.count }}</div>
                    <div class="unit">{{ item.unit }}</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { getAssetsFile } from '@/utils'

const props = defineProps({
    data: {
        type: Array,
        default: () => {
            return {
                img: getAssetsFile('基础/icon_告警统计.png'),
                list: [
                    {
                        name: '严重报警总数',
                        count: 112,
                        unit: '次'
                    },
                    {
                        name: '重要报警总数',
                        count: 148,
                        unit: '次'
                    },
                    {
                        name: '普通报警总数',
                        count: 234,
                        unit: '次'
                    }
                ]
            }
        }
    }
})
</script>

<style scoped lang="scss">
.statistics-list {
    width: 100%;
    display: flex;
    padding: 15px 0;
    font-size: 16px;
    color: #fff;
    font-family: OPPOSans;

    .left {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100px;
        height: 155px;
        background: url('@/assets/images/基础/warnleft_bg.png') no-repeat;
        background-size: 100% 100%;
        margin-right: 10px;
        img {
            width: 55px;
            height: 78px;
        }
    }
    .right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-family: OPPOSans;

        .item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: url('@/assets/images/基础/subtit_bg.png') no-repeat;
            background-size: contain;
            padding: 0 0 0 30px;
            height: 40px;

            .content {
                flex: 1;
                display: flex;
                padding: 0 10px;
                letter-spacing: 2px;
            }
            .end {
                display: flex;
                align-items: flex-end;
                justify-content: space-between;
                .count {
                    font-family: SJyunhei;
                    font-size: 22px;
                    margin-right: 5px;
                }
                .unit {
                    opacity: 0.5;
                }
            }
        }
    }
}
</style>
